<template>
  <el-menu router :collapse="isCollapse">
    <subMenu v-for="item in menuList" :item="item" :key="item.id" :icon="icon"></subMenu>
  </el-menu>
</template>

<script setup lang="ts">
import { computed } from 'vue'
import { useMenuStore } from '@/stores/menu'
import subMenu from './subMenu/indexView.vue'
interface IMenuItem {
  id: number
  path: string
  authauthName: string
  children: IMenuItem[]
}
defineProps({
  isCollapse: Boolean
})

const icon = [
  'icon-yonghuguanli',
  'icon-quanxianguanli',
  'icon-shangpinguanli',
  'icon-dingdanguanli',
  'icon-data-management'
]

// 读取侧边栏数据
const menuList = computed<IMenuItem[]>(() => useMenuStore().menuList) //11111111
</script>

<style scoped>
.el-menu {
  border: none;
}
</style>
